<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <a href="#" @click.prevent="comName='login'">登录</a>
            <a href="#" @click.prevent="comName='register'">注册</a>
            <component v-bind:is="comName"></component>
        </div>
        <script>
            Vue.component('login',{
                template:'<div>登录页面</div>'
            });

            Vue.component('register',{
                template:'<div>注册页面</div>'
            });

            var vm = new Vue({
                el:'#app',
                data:{
                    comName:''
                }
            })
        </script>
    </body>
</html>